import time

from selenium.webdriver import ActionChains

from page import LoginPageHome


class LoginHandle(LoginPageHome):
    # 用户名/密码-清除-输入
    def send_mobile(self, val):
        ActionChains(self.driver).double_click(self.get_mobile_ele()).perform()
        self.get_mobile_ele().send_keys(val)

    def send_pwd(self, val):
        ActionChains(self.driver).double_click(self.get_pwd_ele()).perform()
        self.get_pwd_ele().send_keys(val)

    # 点击登录
    def click_login_button(self):
        self.get_login_button_ele().click()
        time.sleep(1)
